# For more information about using CMake with Android Studio, read the
# documentation: https://d.android.com/studio/projects/add-native-code.html.
# For more examples on how to use CMake, see https://github.com/android/ndk-samples.

# Sets the minimum CMake version required for this project.
cmake_minimum_required(VERSION 3.22.1)

project("ffmpegplayer")

#file(GLOB_RECURSE ALL_SOURCE "*.cpp" "*.c" "*.h")
include_directories(CMAKE_SOURCE_DIR)
include_directories(include)
include_directories(soundtouch/include)
include_directories(soundtouch/SoundTouch)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -L${CMAKE_SOURCE_DIR}/libs/${ANDROID_ABI}")
message(-------------)
message(${CMAKE_SOURCE_DIR})
aux_source_directory(. SOURCE)

aux_source_directory(./soundtouch/SoundTouch SOUNDTOUCH_SOURCE)

add_library(${CMAKE_PROJECT_NAME}
        SHARED
        ${SOURCE}
        ${SOUNDTOUCH_SOURCE}
        ${ALL_SOURCE}
        )

find_library(
        log-lib
        log )

target_link_libraries(${CMAKE_PROJECT_NAME}
        avcodec
        avdevice
        avfilter
        avformat
        avutil
        swresample
        swscale
        OpenSLES
        ${log-lib}
        android)